package com.cwvs.cat.fragment;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.cwvs.cat.R;
import com.cwvs.cat.adapter.ClubDynamicListAdapter;
import com.cwvs.cat.bean.ClubTrends;

public class ClubFragment extends Fragment {

	private Activity mContext;;
	private ListView lv_fg_club_list;
	private ClubDynamicListAdapter clubDynamicListAdapter;
	private List<ClubTrends> list_club_dynamic;

	public ClubFragment() {
		// TODO Auto-generated constructor stub
	}

	private void setList() {
		list_club_dynamic = new ArrayList<ClubTrends>();
		
	}

	@Override
	public void onAttach(Activity activity) {
		// TODO Auto-generated method stub
		super.onAttach(activity);
		mContext = getActivity();
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {

		View contentLayout = inflater.inflate(R.layout.fragment_club,
				container, false);
		Log.d("TAG", "FragmentMessage------onCreateView");

		initView(contentLayout);
		return contentLayout;
	}

	private void initView(View view) {
		lv_fg_club_list = (ListView) view.findViewById(R.id.lv_fg_club_list);
		initListView();
	}

	private void initListView() {

		setList();

		clubDynamicListAdapter = new ClubDynamicListAdapter(mContext,list_club_dynamic);
		lv_fg_club_list.setAdapter(clubDynamicListAdapter);

	}

}
